﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LdapAuthentication;
using Qu.SeniorProject.Model;

namespace TestHarnessConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {

            /*
            string loginName = LdapAuthentication.LdapHelper.GetLoginName("erradi", "???", "Abdelaziz Bouras", "erradi");
            Console.Out.WriteLine(loginName);

            return;
            TestDownload download = new TestDownload();
            download.ShowDialog();
            return;
            */
            string notfound =  StudentRepository.SetMissingUserName();
            Console.Out.WriteLine(notfound);

            return;
            
            var projects = ProjectRepository.GetProjects().Where(p => p.PeriodId == 2 && p.Students.Count() >= 1);
            foreach (var proj in projects)
            {
                try
                {
                    Console.WriteLine(string.Format("{0} - {1}", proj.ProjectId, proj.ProjectTitle));
                    ProjectRepository.SendProjectRegistrationConfirmation(proj);
                }
                catch (Exception ex)
                {
                    Console.WriteLine();
                    Console.WriteLine(ex.Message);
                    Console.WriteLine();
                    System.Threading.Thread.Sleep(61 * 1000);
                    ProjectRepository.SendProjectRegistrationConfirmation(proj);
                }

                //if (count % 5 == 0)
                //    System.Threading.Thread.Sleep(10001);

                //count++;
            }

            //Project proj = ProjectRepository.GetProject(18);
            //ProjectRepository.SendProjectRegistrationConfirmation(proj);
        }

    }
}
